@extends('backend::common.common_right')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                            <a  href="{{url('backend/bannercreate',['type'=>1,'id'=>0])}}" class="btn btn-primary ">添加站内广播消息</a>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover " id="editable">
                            <thead>
                            <tr>
                                <th>站内广播编号</th>
                                <th>广播内容</th>
                                <th>是否展示</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($banner as $ba)
                                <tr class="gradeX">
                                    <td>{{$ba->id}}</td>
                                    <td>{{$ba->title}}</td>
                                    <td class="center">{{$ba->is_show}}</td>
                                    <td class="center">
                                        <a href="{{url('backend/bannercreate',['type'=>$ba->type,'id'=>$ba->id])}}"><i class="fa fa-pencil"></i>编辑</a>&emsp;
                                        <a href="javascript:;" onclick="del({{$ba->type}},{{$ba->id}})"><i class="fa fa-trash"></i>删除</a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
<script>
    var del = function(type,id){
        layer.confirm('确定删除么(不可恢复)？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            window.location.href = "{{url('backend/bannerdel')}}/"+type+'/'+id;
        }, function(){

        });
    }
</script>

@endsection

